package com.xunmaw.supermarket.service.bill;

import com.xunmaw.supermarket.dao.BillDao;
import com.xunmaw.supermarket.pojo.Bill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 功能说明
 */
@Transactional(propagation = Propagation.REQUIRED, rollbackForClassName = "Exception")
@Service
public class BillServiceImpl implements BillService {
 
	@Autowired
	private BillDao billDao;
	
	@Override
	public boolean add(Bill bill) {
		return billDao.add(bill) >= 1 ? true : false;
	}
	
	@Override
	public List<Bill> getBillList(Bill bill) {
		return billDao.getBillList(bill);
	}
	
	@Override
	public boolean deleteBillById(String delId) {
		return billDao.deleteBillById(delId) >= 1 ? true : false;
	}
	
	@Override
	public Bill getBillById(String id) {
		return billDao.getBillById(id);
	}
	
	@Override
	public boolean modify(Bill bill) {
		return billDao.modify(bill) >= 1 ? true : false;
	}
}
